<!DOCTYPE html>
<%@page pageEncoding="UTF-8"%>
<html>
<head>
<title>UMEditor</title>
<%@include file="/resource/component.jsp"%>
<link type="text/css" rel="stylesheet" href="<%=rootPath%>/resource/third-party/htmleditor/umeditor/themes/default/css/umeditor.min.css" />
<script type="text/javascript" src="<%=rootPath%>/resource/third-party/htmleditor/umeditor/third-party/template.min.js"></script>
<script type="text/javascript" src="<%=rootPath%>/resource/third-party/htmleditor/umeditor/umeditor.config.js"></script>
<script type="text/javascript" src="<%=rootPath%>/resource/third-party/htmleditor/umeditor/umeditor.min.js"></script>
</head>
<body>
	<div style="width:90%;">
		<div type="text/plain" id="myEditor" style="height:300px;" Readonly="true">
			<p>默认值</p>
		</div>
	</div>
	
    <div style="margin-top:10px">
        <table>
          <tr>
            <td> <a class="nui-button" onclick="setContent">设置编辑器的值</a></td>
            <td style="padding-left:5px;"><a class="nui-button" onclick="getContent">获取编辑器的值</a></td>
            <td> <a class="nui-button" onclick="setDisabled">设置编辑器只读</a></td>
            <td style="padding-left:5px;"> <a class="nui-button" onclick="setEnabled">取消编辑器只读</a></td>
          </tr>
        </table>
    </div>
<script type="text/javascript">
nui.parse();

var um = UM.getEditor('myEditor');

function getContent() {
    var arr = um.getContent();
    alert(arr);
};
function setContent() {
    um.setContent('WebUI控件库');
}
function setDisabled() {
    um.setDisabled('fullscreen');
};
function setEnabled() {
    um.setEnabled();
}
</script>
</body>
</html>